{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "toc": true
   },
   "source": [
    "<h1>大纲<span class=\"tocSkip\"></span></h1>\n",
    "<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#需求：\" data-toc-modified-id=\"需求：-1\"><span class=\"toc-item-num\">1&nbsp;&nbsp;</span>需求：</a></span></li><li><span><a href=\"#实现步骤：\" data-toc-modified-id=\"实现步骤：-2\"><span class=\"toc-item-num\">2&nbsp;&nbsp;</span>实现步骤：</a></span></li></ul></div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 需求：\n",
    "获取当前文件夹指定类型的文件，创建指定文件同名（不含文件后缀）的文件夹\n",
    "\n",
    "# 实现步骤：\n",
    "1. 获取当前文件夹指定类型的文件列表\n",
    "1. 除去后缀\n",
    "1. 创建文件夹"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-05-07T08:56:17.196576Z",
     "start_time": "2018-05-07T08:56:17.193436Z"
    }
   },
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "def get_file_list(file_type):\n",
    "    file_list = []\n",
    "    for i in os.listdir():\n",
    "        item = i.split('.')\n",
    "        if item[-1] == file_type:\n",
    "            file_list.append(item[0])\n",
    "    return file_list\n",
    "def create_dir(filenames):    \n",
    "    for i in filenames:\n",
    "        os.system('mkdir %s' % (i))\n",
    "# create_dir(get_file_list('md'))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "conda all lib",
   "language": "python",
   "name": "base"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "大纲",
   "title_sidebar": "目录",
   "toc_cell": true,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
